	//............................................................................cef_context_menu_handler_capi
	
	PCefContextMenuHandler = ^TCefContextMenuHandler;
	PCefContextMenuParams = ^TCefContextMenuParams;

	TCefContextMenuHandler=record
		// Base structure.
		base:TCefBase;
		// Called before a context menu is displayed. |params| provides information
		// about the context menu state. |model| initially contains the default
		// context menu. The |model| can be cleared to show no context menu or
		// modified to show a custom menu. Do not keep references to |params| or
		// |model| outside of this callback.
		on_before_context_menu:procedure(self:PCefContextMenuHandler; browser:PCefBrowser; frame:PCefFrame; params:PCefContextMenuParams; model:PCefMenuModel); stdcall;
		// Called to execute a command selected from the context menu. Return true (1)
		// if the command was handled or false (0) for the default implementation. See
		// cef_menu_id_t for the command ids that have default implementations. All
		// user-defined command ids should be between MENU_ID_USER_FIRST and
		// MENU_ID_USER_LAST. |params| will have the same values as what was passed to
		// on_before_context_menu(). Do not keep a reference to |params| outside of
		// this callback.
		on_context_menu_command:function(self:PCefContextMenuHandler; browser:PCefBrowser; frame:PCefFrame; params:PCefContextMenuParams; command_id:Tint; event_flags:TCefEventFlags):Tint; stdcall;
		// Called when the context menu is dismissed irregardless of whether the menu
		// was NULL or a command was selected.
		on_context_menu_dismissed:procedure(self:PCefContextMenuHandler; browser:PCefBrowser; frame:PCefFrame); stdcall;
	end;

	TCefContextMenuParams=record
		// Base structure.
		base:TCefBase;
		// Returns the X coordinate of the mouse where the context menu was invoked.
		// Coords are relative to the associated RenderView's origin.
		get_xcoord:function(self:PCefContextMenuParams):Tint; stdcall;
		// Returns the Y coordinate of the mouse where the context menu was invoked.
		// Coords are relative to the associated RenderView's origin.
		get_ycoord:function(self:PCefContextMenuParams):Tint; stdcall;
		// Returns flags representing the type of node that the context menu was
		// invoked on.
		get_type_flags:function(self:PCefContextMenuParams):TCefContextMenuTypeFlags; stdcall;
		// Returns the URL of the link, if any, that encloses the node that the
		// context menu was invoked on.
		// The resulting string must be freed by calling cef_string_userfree_free().
		get_link_url:function(self:PCefContextMenuParams):PCefStringUserFree; stdcall;
		// Returns the link URL, if any, to be used ONLY for "copy link address". We
		// don't validate this field in the frontend process.
		// The resulting string must be freed by calling cef_string_userfree_free().
		get_unfiltered_link_url:function(self:PCefContextMenuParams):PCefStringUserFree; stdcall;
		// Returns the source URL, if any, for the element that the context menu was
		// invoked on. Example of elements with source URLs are img, audio, and video.
		// The resulting string must be freed by calling cef_string_userfree_free().
		get_source_url:function(self:PCefContextMenuParams):PCefStringUserFree; stdcall;
		// Returns true (1) if the context menu was invoked on an image which has non-
		// NULL contents.
		has_image_contents:function(self:PCefContextMenuParams):Tint; stdcall;
		// Returns the URL of the top level page that the context menu was invoked on.
		// The resulting string must be freed by calling cef_string_userfree_free().
		get_page_url:function(self:PCefContextMenuParams):PCefStringUserFree; stdcall;
		// Returns the URL of the subframe that the context menu was invoked on.
		// The resulting string must be freed by calling cef_string_userfree_free().
		get_frame_url:function(self:PCefContextMenuParams):PCefStringUserFree; stdcall;
		// Returns the character encoding of the subframe that the context menu was
		// invoked on.
		// The resulting string must be freed by calling cef_string_userfree_free().
		get_frame_charset:function(self:PCefContextMenuParams):PCefStringUserFree; stdcall;
		// Returns the type of context node that the context menu was invoked on.
		get_media_type:function(self:PCefContextMenuParams):TCefContextMenuMediaType; stdcall;
		// Returns flags representing the actions supported by the media element, if
		// any, that the context menu was invoked on.
		get_media_state_flags:function(self:PCefContextMenuParams):TCefContextMenuMediaStateFlags; stdcall;
		// Returns the text of the selection, if any, that the context menu was
		// invoked on.
		// The resulting string must be freed by calling cef_string_userfree_free().
		get_selection_text:function(self:PCefContextMenuParams):PCefStringUserFree; stdcall;
		// Returns true (1) if the context menu was invoked on an editable node.
		is_editable:function(self:PCefContextMenuParams):Tint; stdcall;
		// Returns true (1) if the context menu was invoked on an editable node where
		// speech-input is enabled.

        {$ifdef cef_stable}
		is_speech_input_enabled:function(self:PCefContextMenuParams):Tint; stdcall;
        {$endif cef_stable}
        {$ifdef cef_trunk}
        {$endif cef_trunk}

        // Returns flags representing the actions supported by the editable node, if
		// any, that the context menu was invoked on.
		get_edit_state_flags:function(self:PCefContextMenuParams):TCefContextMenuEditStateFlags; stdcall;
	end;
